      function dqsat (t,p)

      implicit double precision (a-h,o-z)
c     write(*,*) 'Qsat:',t,p
      rasrv = 287.05/461.51
      etvq = 1. - rasrv
      esat=618.78*exp(17.269*(t-273.16)/(t-35.86))
      desat=4097.93*esat/((t-35.86)*(t-35.86))
      dqsat=rasrv*desat*p/((p-etvq*esat)*(p-etvq*esat))
      end